<template>
	<view class="page-wrap fboxRow Ycenter Xcenter" :data-theme="theme" :class="theme" :style="globalColor.style">
<!--  App 数字职场 中转操作 -->
<!--    -->
		App 数字职场 中转操作
	</view>
</template>

<script>
import { getRequest } from '@/static/js/common.js';
import { utf8to16, base64decode } from '@/static/js/Base64.js';
export default {
	data() {
		return {
			theme: getApp().globalData.appTheme,
			globalColor: getApp().globalData.globalColor,
			isApp: false,
			navList: [
				{ key: 'deliverCount',  tit: '投过的职位', path: '/recruit/user/deliverPage' },
				{ key: 'interviewCount', tit: '收到的面试', path: '/recruit/user/myInterview' },
				{ key: 'collectJobCount', tit: '收藏的职位', path: '/recruit/user/collectPage' },
				{ key: 'vita', tit: '我的简历', path: '/recruit/user/vita' },
				{ key: 'vitaFile', tit: '附件简历', path: '/recruit/user/vita-file' },
				{ key: 'expect', tit: '求职意向', path: '/recruit/user/vita-expect' },
				{ key: 'vitaSet', tit: '简历设置', path: '/recruit/user/vitaSet' },
				{ key: 'changeCompany', tit: '切换到企业', path: '/recruit/user/enterprise' },
				{ key: 'search', tit: '搜索', path: '/recruit/user/searchList' },
				{ key: 'filter', tit: '筛选', path: '/recruit/common/filter?type=job' },
			]
		};
	},
	onLoad(option) {
		if (option && option.benwu) {
			const benwu = utf8to16(base64decode(option.benwu));
			const token = {
				access_token: getRequest(benwu, 'token'),
				userId: getRequest(benwu, 'userId'),
				statusBarHeight: getRequest(benwu, 'statusBarHeight')
			};
			getApp().globalData.userId = token.userId;
			getApp().globalData.statusBarHeight = token.statusBarHeight;
			uni.setStorageSync('bw_params', JSON.stringify(token));
		}
		if (option && option.isApp) {
			this.isApp = option.isApp == 1 ? true : false;
		}
		if(option && option.transfer){
		  this.goPage(option.transfer)
		}
	},
	methods: {
		goPage(type){
			let url = ''
			this.navList.filter(item=>{
				if(item.key == type){
					if(item.key == 'filter'){
						getApp().globalData.filterTemp = {};
					}
					// this.$pageTo(item.path)
					this.$pageTo(item.path, 'redirectTo')
				}
			})
		}
	}
};
</script>

<style lang="scss" scoped>
	.page-wrap{
		height: 100vh;
	}
</style>
